package InterfaceDemo4;
public class DeviceManager {
    public static void manageNetworkConnection(NetworkDevice networkDevice) {
        System.out.println("\n=== 网络连接管理 ===");
        networkDevice.connectNetwork();
    }

    public static void manageUsbConnection(UsbDevice usbDevice) {
        System.out.println("\n=== USB连接管理 ===");
        usbDevice.connectUsb();
    }

    public static void managePower(Device device, boolean isOn) {
        System.out.println("\n=== 电源管理 ===");
        if (isOn) {
            device.powerOn();
        } else {
            device.powerOff();
        }
    }
}